<?php /*a:2:{s:67:"H:\xampp\htdocs\www\lqb\application\admin\view\list\addProduct.html";i:1564025217;s:63:"H:\xampp\htdocs\www\lqb\application\admin\view\public\head.html";i:1563863606;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>layout 后台管理系统 - Layui</title>
    <script type="text/javascript" src="/static/admin/layui/js/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="/static/admin/layui/layui.js"></script>
    <link rel="stylesheet" type="text/css" href="/static/admin/layui/css/layui.css" />
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">后台管理系统</div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item"><a href="/admin/Product/productListStatus">已上架商品</a></li>
            <li class="layui-nav-item"><a href="#" id="lqb">预览</a></li>
            <li class="layui-nav-item"><a href="/admin/Registered/noMoney" >没有借款</a></li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img src="http://t.cn/RCzsdCq" class="layui-nav-img">
                    <?php echo think\facade\Session::get('user','user_session'); ?>
                </a>
                <!--<dl class="layui-nav-child">-->
                    <!--<dd><a href="">基本资料</a></dd>-->
                    <!--<dd><a href="">安全设置</a></dd>-->
                <!--</dl>-->
            </li>
            <li class="layui-nav-item"><a href="/admin/Index/quit">退出</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-shrink=""  lay-filter="test">
                <li class="layui-nav-item <?php if((app('request')->path() == 'admin/Product/productList') OR (app('request')->path() == 'admin/Click/index') OR (app('request')->path() == 'admin/Product/addProduct') OR (app('request')->path() == 'admin/Category/index')
              OR (app('request')->path() == 'admin/Category/addCategory')): ?>layui-nav-itemed<?php endif; ?>">
                    <a class="" href="javascript:;">产品管理</a>
                    <dl class="layui-nav-child">
                        <dd class="<?php if(app('request')->path() == 'admin/Product/productList'): ?>layui-this<?php endif; ?>"><a href="/admin/Product/productList">产品列表</a></dd>
                        <dd class="<?php if(app('request')->path() == 'admin/Click/index'): ?>layui-this<?php endif; ?>"><a href="/admin/Click/index">产品点击</a></dd>
                        <dd class="<?php if(app('request')->path() == 'admin/Product/addProduct'): ?>layui-this<?php endif; ?>"><a href="/admin/Product/addProduct">添加产品</a></dd>
                        <dd class="<?php if(app('request')->path() == 'admin/Category/index'): ?>layui-this<?php endif; ?>"><a href="/admin/Category/index">产品分类</a></dd>
                        <dd class="<?php if(app('request')->path() == 'admin/Category/addCategory'): ?>layui-this<?php endif; ?>"><a href="/admin/Category/addCategory">添加分类</a></dd>
                        <!--<dd><a href="/admin/Category/index">推广等级</a></dd>-->
                        <!--<dd><a href="/admin/Grade/fetch_add_grade">添加等级</a></dd>-->
                    </dl>
                </li>
                <li class="layui-nav-item <?php if((app('request')->path() == 'admin/Banner/allBanner') OR (app('request')->path() == 'admin/Banner/addBanner')): ?>layui-nav-itemed<?php endif; ?>">
                    <a href="javascript:;">轮播图</a>
                    <dl class="layui-nav-child">
                        <dd class="<?php if(app('request')->path() == 'admin/Banner/allBanner'): ?>layui-this<?php endif; ?>"><a href="/admin/Banner/allBanner">轮播图</a></dd>
                        <dd class="<?php if(app('request')->path() == 'admin/Banner/addBanner'): ?>layui-this<?php endif; ?>"><a href="/admin/Banner/addBanner">添加轮播图</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item <?php if((app('request')->path() == 'admin/Popularize/index') OR (app('request')->path() == 'admin/Popularize/Management') OR (app('request')->path() == 'admin/Popularize/getAllPopularize')
              OR (app('request')->path() == 'admin/Registered/index')): ?>layui-nav-itemed<?php endif; ?>">
                    <a href="javascript:;">推广管理</a>
                    <dl class="layui-nav-child">
                        <dd class="<?php if(app('request')->path() == 'admin/Popularize/index'): ?>layui-this<?php endif; ?>"><a href="/admin/Popularize/index">添加推广账号</a></dd>
                        <dd class="<?php if(app('request')->path() == 'admin/Popularize/Management'): ?>layui-this<?php endif; ?>"><a href="/admin/Popularize/Management">管理推广账号</a></dd>
                        <dd class="<?php if(app('request')->path() == 'admin/Popularize/getAllPopularize'): ?>layui-this<?php endif; ?>"><a href="/admin/Popularize/getAllPopularize">查看所有推广</a></dd>
                        <dd class="<?php if(app('request')->path() == 'admin/Registered/index'): ?>layui-this<?php endif; ?>"><a href="/admin/Registered/index">查看所有注册</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item  <?php if((app('request')->path() == 'admin/Admin/index') OR (app('request')->path() == 'admin/Admin/adminList')): ?>layui-nav-itemed<?php endif; ?>">
                    <a href="javascript:;">登陆账号</a>
                    <dl class="layui-nav-child">
                        <dd class="<?php if(app('request')->path() == 'admin/Admin/index'): ?>layui-this<?php endif; ?>"><a href="/admin/Admin/index">添加后台登陆账号</a></dd>
                        <dd class="<?php if(app('request')->path() == 'admin/Admin/adminList'): ?>layui-this<?php endif; ?>"><a href="/admin/Admin/adminList">管理后台登陆账号</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item <?php if((app('request')->path() == 'admin/File/index') OR (app('request')->path() == 'admin/Log/index')): ?>layui-nav-itemed<?php endif; ?>">
                    <a href="javascript:;">系统管理</a>
                    <dl class="layui-nav-child">
                        <dd class="<?php if(app('request')->path() == 'admin/File/index'): ?>layui-this<?php endif; ?>"><a href="/admin/File/index">图片管理</a></dd>
                        <dd class="<?php if(app('request')->path() == 'admin/Log/index'): ?>layui-this<?php endif; ?>"><a href="/admin/Log/index">操作日志</a></dd>
                        <dd class="<?php if(app('request')->path() == 'admin/Error/index'): ?>layui-this<?php endif; ?>"><a href="/admin/Error/index">错误日志</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <div id="main" class="layui-body">
        <!-- 内容主体区域 -->
        <blockquote class="layui-elem-quote" style="margin: 15px">内容变量</blockquote>
        

<label class="layui-form-label">权重最大:<?php echo htmlentities($info_info['px']); ?> </label>
<label class="layui-form-label">A等级：<?php echo htmlentities($info_info['first']); ?>个</label>
<label class="layui-form-label">B等级：<?php echo htmlentities($info_info['secord']); ?>个</label>
<label class="layui-form-label">C等级：<?php echo htmlentities($info_info['third']); ?>个</label>

<form id="add_from" style="margin: 15px" class="layui-form" method="post" action="/admin/Product/add/id/<?php echo htmlentities((isset($info['product_id']) && ($info['product_id'] !== '')?$info['product_id']:'')); ?>">

    <div class="layui-form-item layui-form-pane">
        <label class="layui-form-label ">推广等级</label>
        <div class="layui-input-inline">
            <select name="grade" id="#grade" lay-filter="grade" lay-verify="required"  autocomplete="off">
                <option value="">请选择推广等级</option>
                <?php if(is_array($gradeName) || $gradeName instanceof \think\Collection || $gradeName instanceof \think\Paginator): $i = 0; $__LIST__ = $gradeName;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
                <option value="<?php echo htmlentities($vo['grade_name']); ?>" <?php if($vo['grade_name']  ==  $info['grade']): ?> selected="selected" <?php endif; ?> ><?php echo htmlentities($vo['grade_name']); ?></option>
                <?php endforeach; endif; else: echo "" ;endif; ?>
            </select>
        </div>

        <label style="display: none" id="px_label" class="layui-form-label">排序</label>
        <div class="layui-input-inline">
            <input type="hidden" name="px" id="grade_px"  value="<?php echo htmlentities((isset($info['px']) && ($info['px'] !== '')?$info['px']:'')); ?>" placeholder="" class="layui-input" lay-verify="required">
            <input type="hidden" name="product_id" value="<?php echo htmlentities((isset($info['product_id']) && ($info['product_id'] !== '')?$info['product_id']:'')); ?>" class="layui-input">
        </div>

        <label class="layui-form-label">贷款分类</label>
        <div class="layui-input-inline">
            <select name="category_id" lay-filter="category" lay-verify="required"  autocomplete="off">
                <option value="">请选择贷款分类</option>
                <?php if(is_array($categoryName) || $categoryName instanceof \think\Collection || $categoryName instanceof \think\Paginator): $i = 0; $__LIST__ = $categoryName;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
                <option value="<?php echo htmlentities($vo['category_id']); ?>" <?php if($vo['category_id']  ==  $info['category_id']): ?> selected="selected" <?php endif; ?> ><?php echo htmlentities($vo['category_name']); ?></option>
                <?php endforeach; endif; else: echo "" ;endif; ?>
            </select>
        </div>

        <input type="checkbox" name="repeat" value="<?php echo htmlentities($info['repeat']); ?>" lay-filter="repeat" id="repeat" title="重复出现" <?php if($info['repeat']  == 1): ?> checked <?php endif; ?>>
    </div>

    <div class="layui-form-item layui-form-pane">
        <label class="layui-form-label">产品标题</label>
        <div class="layui-input-block">
            <input type="text" name="title" placeholder="请输入标题"  class="layui-input" lay-verify="required" value="<?php echo htmlentities((isset($info['title']) && ($info['title'] !== '')?$info['title']:'')); ?>">
        </div>
    </div>

    <div class="layui-form-item layui-form-pane">
        <label class="layui-form-label ">产品图片</label>
        <div class="layui-input-inline">
            <input type="text" id="img_upload_url" name="img_url" required   placeholder="图片地址"  class="layui-input" lay-verify="required" value="<?php echo htmlentities((isset($info['img_url']) && ($info['img_url'] !== '')?$info['img_url']:'')); ?>">
        </div>
        <div class="layui-input-inline" style="width: 50px">
            <img style="width: 37px;height: auto" type="hidden" id="img_upload" src="<?php echo htmlentities($info['img_url']); ?>">
        </div>
        <div class="layui-input-inline">
            <?php if(!(empty($info['img_url']) || (($info['img_url'] instanceof \think\Collection || $info['img_url'] instanceof \think\Paginator ) && $info['img_url']->isEmpty()))): ?>
            <img src="" id="img_url" class="content-photos" style="height: 35px">
            <?php endif; ?>
            <a id="post_img" name="post_img" type="file" class="layui-btn layui-btn-small layui-btn-normal" data-name="thumb" style="margin-left:10px;">
                <i class="layui-icon">&#xe64a;</i>上传图片
            </a>
        </div>
    </div>

    <div class="layui-form-item layui-form-pane">
        <label class="layui-form-label ">申请人数</label>
        <div class="layui-input-inline">
            <input type="text" name="application" required   placeholder="输入申请人数"  class="layui-input" value="<?php echo htmlentities((isset($info['application']) && ($info['application'] !== '')?$info['application']:'')); ?>">
        </div>

        <label class="layui-form-label">成功申请</label>
        <div class="layui-input-inline">
            <input type="text" name="success_application" required   placeholder="输入成功申请人数"  class="layui-input" value="<?php echo htmlentities((isset($info['success_application']) && ($info['success_application'] !== '')?$info['success_application']:'')); ?>">
        </div>
    </div>

    <div class="layui-form-item layui-form-pane">
        <label class="layui-form-label">贷款额度</label>
        <div class="layui-input-inline" >
            <input type="text" name="price_min" placeholder="￥：最低额度"   class="layui-input"  lay-verify="required" value="<?php echo htmlentities((isset($info['price_min']) && ($info['price_min'] !== '')?$info['price_min']:'')); ?>">
        </div>
        <!--<div class="layui-form-mid">-</div>-->
        <div class="layui-input-inline">
            <input type="text" name="price_max" placeholder="￥：最高额度"  class="layui-input"  lay-verify="required" value="<?php echo htmlentities((isset($info['price_max']) && ($info['price_max'] !== '')?$info['price_max']:'')); ?>">
        </div>
    </div>

    <div class="layui-form-item layui-form-pane">
        <label class="layui-form-label ">期限范围</label>
        <div class="layui-input-inline">
            <input type="text" name="limit_time"  placeholder="输入期限范围"  class="layui-input" value="<?php echo htmlentities((isset($info['limit_time']) && ($info['limit_time'] !== '')?$info['limit_time']:'')); ?>">
        </div>

        <label class="layui-form-label">日利息</label>
        <div class="layui-input-inline">
            <input type="text" name="day_interest" required   placeholder="输入日利息"  class="layui-input" lay-verify="required" value="<?php echo htmlentities((isset($info['day_interest']) && ($info['day_interest'] !== '')?$info['day_interest']:'')); ?>">
        </div>
    </div>

    <div class="layui-form-item layui-form-pane">
        <label class="layui-form-label ">申请连接</label>
        <div class="layui-input-block">
            <input type="text" name="application_url" required   placeholder="请输入申请连接"  class="layui-input" lay-verify="required" value="<?php echo htmlentities((isset($info['application_url']) && ($info['application_url'] !== '')?$info['application_url']:'')); ?>">
        </div>
    </div>

    <div class="layui-form-item layui-form-pane">
        <label class="layui-form-label">产品介绍</label>
        <div class="layui-input-block">
            <input type="text" name="introduce"  placeholder="输入产品介绍"  class="layui-input"  value="<?php echo htmlentities((isset($info['introduce']) && ($info['introduce'] !== '')?$info['introduce']:'')); ?>">
        </div>
    </div>

    <div class="layui-form-item layui-form-pane">
        <label class="layui-form-label">审核说明</label>
        <div class="layui-input-block">
            <input type="text" name="application_check"  placeholder="审核说明"  class="layui-input" value="<?php echo htmlentities((isset($info['application_check']) && ($info['application_check'] !== '')?$info['application_check']:'')); ?>">
        </div>
    </div>

    <div class="layui-form-item layui-form-pane">
        <label class="layui-form-label">申请条件</label>
        <div class="layui-input-block">
            <textarea id="build" name="application_condition"  placeholder="请输入" class="layui-textarea" ><?php echo htmlentities((isset($info['application_condition']) && ($info['application_condition'] !== '')?$info['application_condition']:'')); ?></textarea>
        </div>
    </div>

    <hr class="layui-bg-red">

    <div class="layui-form-item layui-form-pane" lay-filter="pay">
        <label class="layui-form-label">还款方式</label>
        <input type="checkbox" value="<?php echo htmlentities($info['pay_zfb']); ?>" name="pay_zfb" lay-filter="pay_zfb" id="zfb" title="支付宝" <?php if($info['pay_zfb']  == 1): ?> checked <?php endif; ?>>
        <input type="checkbox" value="<?php echo htmlentities($info['pay_zfb']); ?>" name="pay_wx" lay-filter="pay_wx" id="wx" title="微信" <?php if($info['pay_wx']  == 1): ?> checked <?php endif; ?>>
        <input type="checkbox" value="<?php echo htmlentities($info['pay_zfb']); ?>" name="pay_app" lay-filter="pay_app" id="app" title="app" <?php if($info['pay_app']  == 1): ?> checked <?php endif; ?>>
        <input type="checkbox" value="<?php echo htmlentities($info['pay_zfb']); ?>" name="pay_BankCard" lay-filter="pay_BankCard"  id="BankCard" title="银行卡" <?php if($info['pay_BankCard']  == 1): ?> checked <?php endif; ?>>
        <input type="checkbox" value="<?php echo htmlentities($info['pay_zfb']); ?>" name="pay_web" lay-filter="pay_web" id="web" title="官网" <?php if($info['pay_web']  == 1): ?> checked <?php endif; ?>>
        <input type="checkbox" value="<?php echo htmlentities($info['pay_zfb']); ?>" name="pay_Money" lay-filter="pay_Money" id="Money" title="现金" <?php if($info['pay_Money']  == 1): ?> checked <?php endif; ?>>
    </div>

    <div class="layui-form-item layui-form-pane">
        <label class="layui-form-label">服务热线</label>
        <div class="layui-input-block">
            <input type="text" name="phone_num"  placeholder="输入服务热线"  class="layui-input" value="<?php echo htmlentities((isset($info['phone_num']) && ($info['phone_num'] !== '')?$info['phone_num']:'')); ?>">
        </div>
    </div>

    <div class="layui-form-item  layui-form-pane">
        <label class="layui-form-label">公司简介</label>
        <div class="layui-input-block">
            <textarea  name="introduction_company" placeholder="简单介绍公司" class="layui-textarea"><?php echo htmlentities((isset($info['introduction_company']) && ($info['introduction_company'] !== '')?$info['introduction_company']:'')); ?></textarea>
        </div>
    </div>

    <div class="layui-form-item layui-form-pane">
        <label class="layui-form-label">后台地址</label>
        <div class="layui-input-block">
            <input type="background" name="bg_url"  placeholder="后台地址"  class="layui-input" value="<?php echo htmlentities((isset($info['bg_url']) && ($info['bg_url'] !== '')?$info['bg_url']:'')); ?>">
        </div>
    </div>

    <div class="layui-form-item layui-form-pane">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <input type="radio" name="status" value="1" title="上架" <?php if($info['status']  == 1): ?> checked <?php endif; ?>>
            <input type="radio" name="status" value="0" title="下架" <?php if($info['status']  == 0): ?> checked <?php endif; ?>>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="formDemo">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>

</form>

<script>
    // 引入form模块
    layui.use(['form','upload','layedit','layer'], function(){
        var layer = layui.layer;
        var form = layui.form;
        var upload = layui.upload;
        var layedit = layui.layedit;
        var index = layedit.build('build',{
            height: 180
        }); //建立编辑器

        form.on('submit(formDemo)', function(data){
            // console.log(layedit.getContent(index));
            // var object = data.field
            // console.log(object);
            // //layer.msg(JSON.stringify(data.field));
            // $.ajax({
            //     url :'/admin/Product/addProduct'
            //     ,data :object
            //     ,method : 'post'
            // })
        });

        upload.render({
            elem: '#post_img'
            ,url: '/admin/Upload/upload_img' //必填项
            ,auto: true
            ,accept: 'file'
            ,method: 'post' //可选项。HTTP类型，默认post
            ,contentType: true    //不可缺
            ,processData: false
            // ,data: {} //可选项。额外的参数，如：{id: 123, abc: 'xxx'}
            ,before: function(obj){ //obj参数包含的信息，跟 choose回调完全一致，可参见上文。
                layer.load(); //上传loading
            }
            ,done: function(res, index, upload){
                layer.closeAll('loading'); //关闭loading
                if(res.code == 200){
                    layer.msg('上传成功');
                    $("#img_upload_url").attr("value",res.path);
                    $("#img_upload").attr("type","");
                    $("#img_upload").attr("src",res.path);
                }
                console.log(res);
            }
        });
        // 监控下拉框
        form.on('select(grade)', function(data){

            console.log(data.value); //得到被选中的值
            var value = data.value;
            <?php if(is_array($gradeName) || $gradeName instanceof \think\Collection || $gradeName instanceof \think\Paginator): $i = 0; $__LIST__ = $gradeName;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
            if(value == '<?php echo htmlentities($vo['grade_name']); ?>'){
                $("#grade_px").attr("type","text");
                $("#px_label")
                $("#grade_px").attr("placeholder","<?php echo htmlentities($vo['input_value']); ?>");
            }
            <?php endforeach; endif; else: echo "" ;endif; ?>
            if(value == ""){
                $("#px_label").attr("display","none");
                $("#grade_px").attr("type","hidden");
            }
        });
        var pay = new Array();
        // 监控支付方式单选框值
        form.on('checkbox(pay_zfb)', function(data){
            // console.log(data.elem.name); //得到checkbox原始DOM对象
            // console.log(data.elem.checked); //是否被选中，true或者false
            // console.log(data.value); //复选框value值，也可以通过data.elem.value得到
            // console.log(data.othis); //得到美化后的DOM对象

            data.elem.checked ? $('#zfb').attr("value",1) : $('#zfb').attr("value",0);
            form.render('checkbox','pay_zfb');
            console.log(data.value);
            //form.render('checkbox');
            //console.log(data.elem.value);
        });
        form.on('checkbox(pay_wx)', function(data){
            data.elem.checked ? $('#wx').attr("value",'1') : $('#wx').attr("value",0);
            form.render('checkbox','pay');
        });
        form.on('checkbox(pay_app)', function(data){
            data.elem.checked ? $('#app').attr("value",'1') : $('#app').attr("value",0);
            form.render('checkbox','pay');
        });
        form.on('checkbox(pay_BankCard)', function(data){
            data.elem.checked ? $('#BankCard').attr("value",'1') : $('#BankCard').attr("value",0);
            form.render('checkbox','pay');
        });
        form.on('checkbox(pay_web)', function(data){
            data.elem.checked ? $('#web').attr("value",'1') : $('#web').attr("value",0);
            form.render('checkbox','pay');
        });
        form.on('checkbox(pay_Money)', function(data){
            data.elem.checked ? $('#Money').attr("value",'1') : $('#Money').attr("value",0);
            form.render('checkbox','pay');
        });
        form.on('checkbox(repeat)', function(data){
            data.elem.checked ? $('#repeat').attr("value",'1') : $('#repeat').attr("value",0);
            form.render('checkbox','pay');
        });

        // $('#img_upload').on('click', function() {
        //     layer.open({
        //         type: 1,
        //         title: false,
        //         closeBtn: 0,
        //         area: '1200px',
        //         skin: 'layui-layer-nobg', //没有背景色
        //         shadeClose: true,
        //         content: $('#tong')
        //     });
        // });
        // ajax提交表格监听

    });

</script>



    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © layui.com - 感谢
    </div>
</div>
<script>
    //JavaScript代码区域
    var url = window.location.href;
    var callback = url.split("&").pop().replace(/callback=/, "");

    function getQueryVariable(variable)
    {
        var query = window.location.search.substring(1);
        var vars = query.split("&");
        for (var i=0;i<vars.length;i++) {
            var pair = vars[i].split("=");
            if(pair[0] == variable){return pair[1];}
        }
        return(false);
    }

    layui.use(['element','layer'], function(){
        var element = layui.element;
        var layer = layui.layer;
        $("#lqb").click(function(){
            layer.open({
                type: 2,
                area: ['840px', '480px'],
                fixed: false, //不固定
                maxmin: true,
                content: 'http://www.lqb2018.cn',
            });
        });
    });
</script>
</body>
</html>